#include "include/core/Node.h"

#include <QUuid>

Node::Node(const QString &id, const QString &address, quint16 port, const QColor & paintColor)
    : id(id), address(address), port(port), paintColor(paintColor) {
    lastSeenTime = QTime::currentTime();
}

bool Node::operator ==(const Node &b) const {
    if (this->id == b.id) {
        return true;
    }
    return false;
}

QString Node::generateUniqueId() {
    return QUuid::createUuid();
}

void Node::updateLastSeenTime() {
    lastSeenTime = QTime::currentTime();
}
